package crm.model.teacherPC.net.job;

import java.io.IOException;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;

import crm.model.NetConst;
import crm.model.teacherPC.net.StudentPC;

public class UserJob implements Job {
	StudentPC pc;
	public UserJob(StudentPC pc){
		this.pc=pc;
	}
	@Override
	public Object doing(ObjectInputStream is, ObjectOutputStream os) {
		try{
			os.writeObject(NetConst.LOGGEDUSER);
			String userName = (String)is.readObject();
			pc.setUser(userName);
		}catch (IOException e){
			e.printStackTrace();
		} catch (ClassNotFoundException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		return null;
	}

}
